package org.wolfengi.handler.common;

import org.wolfengi.handler.util.ConfigUtil;

/**
 * @Author: wolfengi
 * @Description: ${TODO}
 * @Date: Created in 11:19 2020/5/19
 * @Modified By:
 */
public class Constants {
    public static final String HDFSURI = ConfigUtil.getProperty("hdfs.url");
    public static final String HDFSUSER = ConfigUtil.getProperty("hdfs.user");
    /**
     * 清洗的 HDFS 文件路径
     */
    public static String inputPath = ConfigUtil.getProperty("path.input");
    /**
     * 清洗后的结果输出文件路径（HDFS）
     */
    public static String ouputPath = ConfigUtil.getProperty("path.output");
    public static final String DIRVERCLASS = ConfigUtil.getProperty("jdbc.driver");
    public static final String URL = ConfigUtil.getProperty("jdbc.url");
    public static final String USERNAME = ConfigUtil.getProperty("jdbc.username");
    public static final String PASSWORD = ConfigUtil.getProperty("jdbc.password");
    /**
     * 本地文件或目录 路径，用于上传到 HDFS 进行分析的本地文件
     */
    public static final String LOCALPATH = ConfigUtil.getProperty("local.path");
    /**
     * HDFS文件或路径，注意如果为路径时且 HDFS 无此路径，上传的文件名会成为以此名称进行保存
     */
    public static final String HDFSPATH = ConfigUtil.getProperty("hdfs.path");
    /**
     * 是否重新上传要清洗的文件到 HDFS 中
     */
    public static final boolean ISLOAD = Boolean.parseBoolean(ConfigUtil.getProperty("file.reload"));
    /**
     * 是否进行请洗字典数据
     */
    public static final boolean DICTLOAD = Boolean.parseBoolean(ConfigUtil.getProperty("dict.load"));
    /**
     * 进行分析的字典数据文件名称，注意：如果 HDFS 中的文件名不对应，则无法清洗
     */
    public static final String DICTNAME = "dict.txt";
    /**
     * 进行清洗的详细数据文件名称，注意：如果 HDFS 中的文件名不对应，则无法清洗
     */
    public static final String DATANAME = "data.txt";
    /**
     * 字典
     */
    public static final String F_SHIP_DICT = "f_ship_dict";
    public static final String[] F_SHIP_DICT_FIELDS = {"mmsi", "weight", "ship_age", "ship_type"};
    /**
     * 诊断故障船型
     */
    public static final String F_SHIP_TYPE_COUNT = "f_ship_type_count";
    public static final String[] F_SHIP_TYPE_COUNT_FIELDS = {"mmsi", "syear", "fault", "count"};
    /**
     * 诊断故障原因
     */
    public static final String F_SHIP_FAULT_COUNT = "f_ship_fault_count";
    public static final String[] F_SHIP_FAULT_COUNT_FIELDS = {"fault", "count"};
    /**
     * 诊断船龄
     */
    public static final String F_SHIP_AGE_COUNT = "f_ship_age_count";
    public static final String[] F_SHIP_AGE_COUNT_FIELDS = {"mmsi", "count"};
    /**
     * 诊断故障原因下的不同船型
     */
    public static final String F_SHIP_FAULT_TYPE_COUNT = "f_ship_fault_type_count";
    public static final String[] F_SHIP_FAULT_TYPE_COUNT_FIELDS = {"fault_type", "count", "mmsi"};
    /**
     * 诊断故障与状态
     */
    public static final String F_SHIP_GROUP_COUNT = "f_ship_group_count";
    public static final String[] F_SHIP_GROUP_COUNT_FIELDS = {"state_type", "count"};
    /**
     * 诊断出行率
     */
    public static final String F_SHIP_TRAVEL_RATE_COUNT = "f_ship_travel_rate_count";
    public static final String[] F_SHIP_TRAVEL_RATE_COUNT_FIELDS = {"mmsi", "sdatetime", "state", "count"};
    /**
     * 概览
     */
    public static final String F_SHIP_OVERVIEW_COUNT = "f_ship_overview_count";
    public static final String[] F_SHIP_OVERVIEW_COUNT_FIELDS = {"type_name", "num"};

}
